package cn.stronglink.asset.module.sys.log.service;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.plugins.Page;

import cn.stronglink.asset.model.Permission;
import cn.stronglink.asset.model.SysOperateLog;
import cn.stronglink.asset.module.sys.log.mapper.SysLogMapper;

@Service
@Transactional(rollbackFor=Exception.class) 
public class SysLogService {
	
	@Autowired
	private SysLogMapper sysLogMapper;

	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public List<Permission> qryPermission(Map<String, Object> params) {
		return sysLogMapper.qryPermission(params);
	}
	
	public void insertOperateLog(SysOperateLog log) {
		sysLogMapper.insertOperateLog(log);
		
	}
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public Page<SysOperateLog> qryList(Page<SysOperateLog> page, Map<String, Object> params) {
		List<SysOperateLog> list = sysLogMapper.qryList(page,params);
		page.setRecords(list);
		return page;
	}

	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public SysOperateLog qryById(Long id) {
		SysOperateLog sysOperateLog = sysLogMapper.qryById(id);
		return sysOperateLog;
	}
	
	
	


	

}
